<?php
  class book{

    public function getBook(){
      M()->select('book');
    }

    public function add(){
      $data=json_decode($_POST['data'],true);
      return M()->insert('book',$data);
    }

    public function del(){
    echo M()->del('book','ISBN="'.$_POST['ISBN'].'"');
    }

    public function update(){
      $data=json_decode($_POST['data'],true);
      M()->update('book',$data,' ISBN="'.$data['ISBN'].'"');
    }
  }
?>
